using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class vNetsalesSummationMap : EntityTypeConfiguration<vNetsalesSummation>
    {
        public vNetsalesSummationMap()
        {
            // Primary Key
            this.HasKey(t => t.custid);

            // Properties
            this.Property(t => t.StorName)
                .HasMaxLength(30);

            this.Property(t => t.custname)
                .HasMaxLength(110);

            this.Property(t => t.custid)
                .IsRequired()
                .HasMaxLength(6);

            this.Property(t => t.SYMBOL)
                .HasMaxLength(5);

            this.Property(t => t.base1)
                .HasMaxLength(5);

            this.Property(t => t.base2)
                .HasMaxLength(5);

            // Table & Column Mappings
            this.ToTable("vNetsalesSummation");
            this.Property(t => t.StorId).HasColumnName("StorId");
            this.Property(t => t.DATE).HasColumnName("DATE");
            this.Property(t => t.StorName).HasColumnName("StorName");
            this.Property(t => t.custname).HasColumnName("custname");
            this.Property(t => t.custid).HasColumnName("custid");
            this.Property(t => t.disc).HasColumnName("disc");
            this.Property(t => t.SYMBOL).HasColumnName("SYMBOL");
            this.Property(t => t.base1).HasColumnName("base1");
            this.Property(t => t.base2).HasColumnName("base2");
            this.Property(t => t.TotalLL).HasColumnName("TotalLL");
            this.Property(t => t.Total_).HasColumnName("Total$");
        }
    }
}
